package com.huazai.juc.cec.thread.july.twentyOne;

public class ShareData {

    public static void main(String[] args) {
        TraditionProducerConsumer producerAndConsumer = new TraditionProducerConsumer();
        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                producerAndConsumer.increment();
            }
        }, "producer").start();

        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                producerAndConsumer.decrement();
            }
        }, "consumer").start();
    }
}
